package com.open.cloud.rbac.entity.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 用户登录信息
 * </p>
 *
 * @author wangzengzhou01
 * @since 2024-12-23
 */

@Data
@ApiModel(value = "CoreUserLoginInfo对象", description = "用户登录信息")
@TableName("core_user_login_info")
public class CoreUserLoginInfo extends Model<CoreUserLoginInfo> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "编号")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "用户名称")
    @TableField("user_login_name")
    private String userLoginName;

    @ApiModelProperty(value = "用户密码")
    @TableField("user_login_password")
    private String userLoginPassword;

    @ApiModelProperty(value = "登录失败次数")
    @TableField("login_fail_times")
    private Integer loginFailTimes;

    @ApiModelProperty(value = "最后登录时间")
    @TableField("last_login_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLoginTime;

    @ApiModelProperty(value = "锁定时间")
    @TableField("lock_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lockTime;

    @ApiModelProperty(value = "锁定类型 当前用户ID")
    @TableField("lock_type")
    private String lockType;

    @ApiModelProperty(value = "login_ip")
    @TableField("login_ip")
    private String loginIp;

    @ApiModelProperty(value = "是否为初始密码 0 -修改密码1 -初始密码")
    @TableField("init_password_flag")
    private String initPasswordFlag;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
